<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>在线考试登录</title>
    <link rel="stylesheet" href="js/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <script src="js/bower_components/jquery/dist/jquery.min.js"></script>
    <script src="js/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <script>
        $(function () {
            $("#btnLogin").click(function () {
                param = '{"pager":{"pageoffset":0,"pagesize":2},"pername":"1","pwd":"1"}';
                var id = $("#txtAccount").val();
                $.ajax({
                    type: "POST",
                    url: "http://localhost:9999/getPersonWhereAll",
                    data: param,
                    dataType: "json",
                    contentType: "application/json;charset=utf-8",
                    success: function (data) {
                        alert(data.username);
                        location.href = "html/index.html";
                    },
                    error: function (data) {
                        console.log(data.responseText);
                        console.log(data.date);
                    }
                });
            });
            $("#btnClear").click(function () {
                $("#txtAccount").val("");
                $("#txtPwd").val("");
            });
        });
    </script>

</head>
<body>
<div class="container">
    <div class="row col-md-12">
        <div class="col-md-3"></div>
        <div class="col-md-6">
            <div class="panel panel-primary" style="margin-top: 150px;">
                <div class="panel-heading"><strong>在线考试管理系统</strong></div>
                <div class="panel-body">
                    <div class="input-group">
                            <span class="input-group-addon" id="basic-addon1">
                                <span class="glyphicon glyphicon-user"></span>
                            </span>
                        <input id="txtAccount" type="text" class="form-control"
                               placeholder="账号">
                    </div>
                    <br>
                    <div class="input-group">
                            <span class="input-group-addon" id="basic-addon2">
                                <span class="glyphicon glyphicon-lock"></span>
                            </span>
                        <input id="txtPwd" type="password" class="form-control"
                               placeholder="密码">
                    </div>
                    <br>
                    <div class="btn-group-lg text-right">
                        <button id="btnLogin" type="button" class="btn btn-success">登录</button>
                        <button id="btnClear" type="button" class="btn btn-danger">重置</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-3"></div>
    </div>
</div>
</body>
</html>